package com.CGFrame.struts.bean.project;

import java.util.ArrayList;

public class ElementFileBean {
	private String[] characters;
	private String[] charactersshort;
	private String[] props;
	private String[] propsshort;
	private String[] scenes;
	private String[] scenesshort;
	
	public ElementFileBean(String cha,String pro, String sce) throws Exception
	{
		if (cha.equals("")==false && cha!=null)
		{
			String[] tempcharacters = cha.split(";");
			int length = tempcharacters.length;
			characters = new String[length];
			charactersshort = new String[length];
			for (int i = 0 ; i<length ;i++)
			{
				String[] character = tempcharacters[i].split(",");
				if (character.length ==1)
				{
					characters[i]=character[0];
					charactersshort[i]="";
				}
				if (character.length ==2) 
				{
					characters[i]=character[0];
					charactersshort[i]=character[1];
				}
			}
			
		}
		if(pro.equals("")==false && pro!=null)
		{
			String[] tempprops = pro.split(";");
			int length = tempprops.length;
			props = new String[length];
			propsshort= new String[length];
		
			for (int i = 0 ; i<length ;i++)
			{
				String[] prop = tempprops[i].split(",");
				if (prop.length ==1){
					props[i]=prop[0];
					propsshort[i]="";
				}
				if (prop.length ==2){
					props[i]=prop[0];
					propsshort[i]=prop[1];
				}
			}
		
		}
		
		if(sce.equals("")==false && sce!=null)
		{
			String[] tempscenes=sce.split(";");
			int length = tempscenes.length;
			scenes = new String[length];
			scenesshort= new String[length];
			
			for (int i = 0 ; i<length ;i++)
			{
				String[] scene = tempscenes[i].split(",");
				if (scene.length ==1){
					scenes[i]=scene[0];
					scenesshort[i]="";
				}
				if(scene.length ==2){
					scenes[i]=scene[0];
					scenesshort[i]=scene[1];
				}
			}
			
		}
	}
	public String[] getCharacters()
	{
		return  this.characters;
	}
	public String[] getCharactersShort()
	{
		return this.charactersshort;
	}
	public String[] getProps()
	{
		return this.props;
	}
	public String[] getPropsShort()
	{
		return this.propsshort;
	}
	public String[] getScenes()
	{
		return this.scenes;
	}
	public String[] getScenesShort()
	{
		return this.scenesshort;
	}
	
}
